package com.practice.ajCollections010.map.hashmap;

import java.util.HashMap;
import java.util.Set;

/**
 * 获取元素
 */
public class GetElement {
    public static void main(String[] args) {
        HashMap<String, String> hashMap = new HashMap<>();
        hashMap.put("Hello", "Hello");
        hashMap.put("Mr", "Mr");
        hashMap.put("yang", "yang");

        String yang = hashMap.get("yang");
        System.out.println(yang);

        if (hashMap.containsKey("Hello")) {
            System.out.println(hashMap.get("Hello"));
        }

    }
}
